<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-financialManagement-edit" th:object="${elevatorFault}">
            <input id="faultId" name="faultId" th:field="*{faultId}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>处理意见：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('business_handle_suggestion')}">
						<input type="radio" th:id="${dict.dictCode}" name="disposeOpin" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}" required>
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>故障描述：</label>
				<div class="col-sm-8">
					<textarea id="faultMessage" name="faultMessage" placeholder="请输入故障描述" maxlength="500" rows="5" class="form-control" required="true"></textarea>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "business/elevatorFault";
		function submitHandler() {
			let faultMessage = $("#faultMessage").val();
			if (faultMessage == "" || faultMessage == null || faultMessage == undefined){
				$.modal.msgError("请输入故障描述");
			}else {
				$.ajax({
					type: "post",
					url: prefix + "/immediatelyHandle",
					data: {
						"faultId": $("#faultId").val(),
						"disposeOpin": $("input[name='disposeOpin']:checked").val(),
						"faultMessage": faultMessage
					},
					success: function(r) {
						if (r.code === web_status.SUCCESS) {
							$.modal.msgReload("处理完成！");
						}
					}
				});
			}
		}
	</script>
</body>
</html>
